
	<table width="100%" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
  </table>
      <table width="100%" class="bdcol" height="155" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top"><table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="450" background="images/dh_back_1.gif"></td>
              <td width="100" background="images/dh_back_1.gif"><div align="center">
			  <script language="javascript">
			    function openeditwindow(x){

				   window.open("editleaveword.php?id="+x,"newframe","top=100,left=200,width=450,height=280,menubar=no,location=no,scrollbars=no,status=no");

				}
			  </script>


			  </div></td>
            </tr>
          </table>
            <!-- <table width="100%" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td></td>
              </tr>
            </table> -->

			<link rel="stylesheet" href="/css/custom.css" />
			<div class="header" style="height:300px">
				<div class="headinfobox" style="">
					<div class="column" style="border:0px solid red;">
						<div  style="border:0px solid red;text-align:center">
							<p style="font-size:36px;font-weight:normal;color:#fff;line-height:200px">实况看板</p>
							<!-- <p style="font-size:36px;font-weight:normal;color:#fff;">04月11日  星期日</p> -->
							<p style="font-size:36px;font-weight:normal;color:#99FF00;">
								<?php
								    $weekarray=array("日","一","二","三","四","五","六");
									echo date('m月d日 星期'). $weekarray[date("w")];;
								?>
						</p>

						</div>





						<!-- <span class="jrjl" style="font-size:0.8rem;border:0px solid red"></span> -->



					</div>



				</div>
			</div>
						<style type="text/css">
			                /*.list_icons{ margin-top: 3.333333%; margin-left: 46%; list-style:none ; }*/
			                .list_icons{ margin-top: 3.333333%; margin-left:
								<?php
								$ex_cnt = count($ex_data);
									if( $ex_cnt == 0 ){
										echo '0px';
									}else if( $ex_cnt == 1 ){
										echo '453px';
									}else if ( $ex_cnt ==2 ){
										echo '360px';
									}else if ( $ex_cnt == 3 ){
										echo '269px';
									}else if ( $ex_cnt == 4 ){
										echo '177px';
									}else{
										echo '90px';
									}


								 ?>
								 	; list-style:none ; }
			                .list_icons li{width: 150px; background: #304674; float: left; margin: 0 3% 3% 0;border: 1px solid red;padding-bottom: 0.900rem;}/*dadfe9*/
			                .list_icons span{ display: block; width: 1.120rem; height: 1.355rem; margin: 0 auto; margin-top: 0.900rem; }
							/*.list_icons li span {color:#FFF}*/
			                .list_icons i{font-size: 0.747rem; color: #4a4a4a; text-align: center; font-style: normal;display: block; padding-top: 0.500rem; margin: 0 auto;color:#FFF}
							table tr td span {color:#c4c8cc;font-size:16px}
							table tr td {height:30px}
							.wtd1{width:100px}
							.wtd2{width:300px}
        				</style>
		<table border =0 height='100px' width="100%" style="padding-left:10px;border-bottom:0px solid #1f2c51">
			<tr>
				<td height="20px"></td>
				<td height="20px"></td>
			</tr>
			<tr >
				<td width="330px">
					<span style="color:#FFF;font-size:24px">天气预报:&nbsp&nbsp&nbsp<?php echo $code['provcn'].$code['namecn']?></span>
				</td>
				<td><span style="color:#FFF;font-size:24px"><?php echo $code['temperature']?>℃&nbsp<?php echo $code['weather']?></span></td>
			</tr>
			<?php $list = ''; ?>
			<?php if( $alarmlist['Alarmarr'] != '' ){ ?>
				<?php foreach ($alarmlist['Alarmarr'] as $k => $v) { ?>
			<tr style="cursor:pointer;" onclick="codecontent(['<?php echo $v['time']?>' , '<?php echo $v['content']?>'])">
			<!-- <tr onclick="codecontent(['234' , '123'])"> -->
				<td width="330px">
					<span  style="color:#FFF;font-size:24px">天气预警:&nbsp&nbsp&nbsp</span><span style="font-size:24px;color:<?php echo $v['color_Alarm']?>"><?php echo $v['title']; ?></span>
				</td>
				<td> <span style="color:#FFF;font-size:24px"><?php echo $v['s_time']; ?></span><span class="bluetext" style="font-size:24px"> &nbsp&nbsp&nbsp&nbsp查看警情</span></td>
			</tr>



			<?php } ?>
			<tr>
				<td height="20px"></td>
			</tr>
			<?php } ?>
		</table>
		<div class="" style="display:<?php if( $ex_data == [] ){
			echo 'none';
		}else{echo '';} ?>">
			<div class="" style="border-bottom:5px solid #1f2c51;">

			</div>
		<div class="" style="width:100px;margin-top:20px">

		</div>
		<!-- ul begin -->

<h2 style="text-align:center;font-size:30px;font-weight:none;font-family:serif;color:red">小区异常住户</h2>
		<ul class="list_icons clearfix">
<!-- ex foreach begin -->
		<?php foreach( $ex_data as $k=>$v ){ ?>

			<a href="#<?php echo $v['did'] ?>">
		       <li>
				   <i style="text-align:left;font-size:16px;padding-left:10px;"></i>
		            <div style="text-align:center;padding-top:10px;border:0px solid red"><img style="width: 5rem; height: 5rem; border-radius: 100%;" src="http://www.laoyou1.me/shhomer/output/GetImg.php?did=<?php echo $v['did'];?>"/></div>
		            <i style="font-size:24px"><?php echo $v['name'];?></i>
		       </li>
			</a>
		<?php } ?>
<!-- ex foreach end -->
		   </ul>

		   	</div>
		<!-- ul end -->
		<div class="" style="clear:both;width:100%;margin-top:0px;margin-bottom:20px;border-bottom:5px solid #1f2c51">

		</div>

		<!-- foreach begin -->
<div class="">


		<?php foreach ( $datas as $k=>$v ){ ?>
<div style="border:0px solid blue">
	<a style="position:relative;top:-200px;" id="<?php echo $v['did'];?>" >&nbsp</a>
	<a href="./index.php?id=new&gatename=<?php echo $v['name']?>&did=<?php echo $v['did']?>&groupID=<?php echo empty($_GET['groupID']) ? '2':$_GET['groupID']?>" style="border:0px solid red" >
	<!-- <a href="" style="border:0px solid red" > -->

		<table border =0  width="210px" style="padding-left:10px;float:left">
			<!-- <span>1</span> -->
			<!-- <tr>
				<td style=""><span><?php echo $k+1;?></span></td>
			</tr> -->

			<tr style="text-align:center">
				<td><span style="font-size:24px;color:#FFF;"><?php echo ($k+1); ?></span></td>
				<td><span style="font-size:24px;color:<?php echo $v['line']?>"><?php echo $v['name']?></span></td>

			</tr>
			<tr>
				<td></td>
				<td style="height:20px"></td>
			</tr>
			<tr style="text-align:center">
				<td></td>
				<td><img width="100px" height="100px" src="http://www.laoyou1.me/shhomer/output/GetImg.php?did=<?php echo $v['did'];?>" style="border-radius:100px"></td>

			</tr>
			<tr>
				<td style="height:20px"></td>
			</tr>
			<tr style="text-align:center">
				<td></td>
				<td><span style="color:#FFF">室温:</span><span class="bluetext"><?php echo $v['wenduindoor']['Data']?>℃</span></td>


			</tr>
		</table>
<!-- </a> -->
		<table border=0 width="50%" style="padding-left:10px;float:left">
			<tr style="display:<?php echo $v['Alarm_HomePage']['State'];?>">
				<td  class="wtd1"><span style="color:#FFF;font-size:22px">今日警情</span></td>
				<td  class="wtd2"></td>
			</tr>

			<?php $lens =  count( $v['Alarm_HomePage']['Night']); ?>
			<tr class="tdlastnight" id='last_night_info' v-cloak style="display:<?php if(  $lens > 1){ echo ''; }else{echo 'none';} ?>" onclick="last_night_info(<?php echo $k ?>);return false">
				<td  class="wtd1">

					<span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span style="color:red">昨夜睡眠</span>
				</td>
				<td  class="wtd2">
					<span style="color:red">异常&nbsp&nbsp&nbsp</span><span style="color:#14bb9f"> 查看详情</span>
				</td>
			</tr>
			<tr id='last_night_one' v-cloak style="display:<?php if( ($lens == 1) && ($v['Alarm_HomePage']['Night'][0]['cnt'] !=0 ) ){echo '';}else{echo 'none';} ?>">
				<td  class="wtd1">
					<span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span style="color:red">昨夜睡眠</span>
				</td>
				<td  class="wtd2">
					<span><?php echo $v['Alarm_HomePage']['Night'][0]['last_time'];?>&nbsp&nbsp&nbsp</span><span style="color:#14bb9f"> <?php echo $v['Alarm_HomePage']['Night'][0]['comment'].'&nbsp&nbsp'.$v['Alarm_HomePage']['Night'][0]['cnt'];?><?php if( $v['Alarm_HomePage']['Night'][0]['cnt'] == 0 ){echo '';}else{echo '次';} ?></span>
				</td>
			</tr>

			<?php if ( $v['Alarm_HomePage']['Data'] != '' ) {?>
			<?php foreach ($v['Alarm_HomePage']['Data'] as $value) { ?>


				<tr>
					<td  class="wtd1">
						<span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
						<span style="color:red"><?php echo $value['fire']; ?></span>
					</td>
					<td  class="wtd2">
						<span> <?php echo $value['level']; ?>&nbsp级  <?php echo $value['timestmp']?> </span><span style="color:<?php echo $value['Alarm_color'];?>">&nbsp&nbsp&nbsp<?php echo $value['Alarm'] ?></span>
					</td>
				</tr>
			<?php }?>
			<?php }?>
			<tr>
				<td  class="wtd1"><span style="color:#FFF;font-size:22px">今日摘要</span></td>
				<td  class="wtd2"></td>
			</tr>
			<tr style="display:<?php echo $v['Newfire'][2]?>">
				<td  class="wtd1">
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span><?php if( $v['Newfire'][0] =='loading' ){echo '正在开火';} ?></span>
				</td class="wtd2">
				<td><span class="bluetext"><?php echo $v['Newfire'][1].'分钟'?></span></td>


			</tr>
			<tr style="display:<?php echo $v['activityindoor']['Status']?>">
				<td  class="wtd1">
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span><?php echo $v['activityindoor']['timestmp']?></span>
				</td class="wtd2">
				<td><span class="bluetext"><?php echo $v['activityindoor']['cid']?></span></td>


			</tr>
			<tr  style="display:<?php echo $v['bp']['State']?>">
				<td  class="wtd1">
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span>血压心率</span>
				</td>
				<!-- <td class="wtd2"><span class="bluetext"><?php  echo date('H:i' , strtotime( $v['bp'][0] ))?></span>&nbsp&nbsp&nbsp<span class="bluetext"><?php  echo $v['bp'][1].'/'.($v['bp'][2]+0).'&nbsp&nbsp'.($v['bp'][3]+0);?></span></td> -->
				<td class="wtd2"><span class="bluetext"><?php  echo date('H:i' , strtotime( $v['bp'][0] ))?></span>&nbsp&nbsp&nbsp<span class="
					<?php
					if( $v['bp'][1] != '?' ){
						if( ($v['bp'][1] >=90) && ($v['bp'][1] <=140)  ){
							echo 'bluetext';
						}else{
							echo 'redtext';
						}
					}else{
						echo 'bluetext';
					}
					?>"><?php
						if($v['bp'][1] == '?' ){
							echo '?';
						}else{
							echo (int)$v['bp'][1];
						}
					 ?></span><span class="bluetext">/</span><span class="
					<?php
					if( $v['bp'][2] != '?' ){
						if( ($v['bp'][2] >=60) && ($v['bp'][2] <=90)  ){
							echo 'bluetext';
						}else{
							echo 'redtext';
						}
					}else{
						echo 'bluetext';
					}
					?>"><?php

					 if( $v['bp'][2] == '?' ){
						 echo '?';
					 }else{
						 echo (int)$v['bp'][2];
					 }
					 ?></span>&nbsp&nbsp<span class="
					<?php
					if( $v['bp'][3] != '?' ){
						if( ($v['bp'][3] >=60) && ($v['bp'][3] <=100)  ){
							echo 'bluetext';
						}else{
							echo 'redtext';
						}
					}else{
							echo 'bluetext';
					}
					?>"><?php
					if( $v['bp'][3] == '?' ){
						echo '?';
					}else{
						echo (int)$v['bp'][3];
					}
					 ?></span>	</td>
			</tr>
			<tr  style="display:<?php echo $v['mp']['State'];?>">
				<td class="wtd1">
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span>吃药时间</span>
				</td>
				<td class="wtd2"><span class="bluetext"><?php echo date('H:i' , strtotime($v['mp']['Data']));?></span></td>
			</tr>
			<tr style="display:<?php if(!isset($v['wakeup'])){echo 'none';}else{echo '';}?>">
				<td  class="wtd1">
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span>起床时间</span>
				</td>
				<td class="wtd2"><span class="bluetext"><?php echo $v['wakeup'];?></span></td>
			</tr>
			<!-- <tr style="display:<?php if($v['Alarm_HomePage']['time_warning'] == 'none'){echo '';}else{echo 'none';}?>">
				<td class="wtd1" >
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span>昨夜睡眠</span>
				</td>
				<td class="wtd2"><span class="bluetext"><?php echo $v['Alarm_HomePage']['Night'];?></span></td>
			</tr> -->
			<tr id="sleep_nice_one" v-cloak style="display:<?php if( ($lens==1) || ($v['Alarm_HomePage']['Night'][0]['cnt'] ==0) ){echo '';}else{echo 'none';} ?>">
				<td class="wtd1" >
					 <span style="padding-right:15px"><img src="http://www.laoyou1.me/version1.3/img/yuan.png" width="10px" alt=""></span>
					<span>昨夜睡眠</span>
					<td class="wtd2"><span class="bluetext"><?php echo $v['Alarm_HomePage']['Night'][0]['comment'];?></span></td>
				</td>
            </tr>
		</table>



		<div class="" style="clear:both;">

		</div>
		<br/>
		<div class="" style="border-top:5px solid #1f2c51;width:100%;margin-bottom:0px"></div>
			<br/>
		</a>
		</div>
		<div id="information<?php echo $k; ?>"  class="tdnone" style="padding:20px 0;;display:none">
			<table border=0  align=center>
				<?php foreach( $v['Alarm_HomePage']['Night'] as $klist => $vlist ){ ?>
					<tr id="last_info">
						<td width="20px"><?php echo $klist+1; ?></td>
						<td width="120px"><?php echo  $vlist['last_time']; ?></td>
						<td width="100px" align="left"><?php echo  $vlist['comment']; ?></td>
						<td width="20px"><?php echo $vlist['cnt'] ?></td>
						<td width="20px">次</td>
					</tr>
				<?php } ?>
			</table>
			<div style="text-align:center;width:80%;margin:auto;margin-top:5%;">
				<input type="button" value="确定" class="feedbackbtn" style="width:40%;" onclick="guanbi()" />
			</div>
		</div>

		<?php } ?>
		</div>
<!-- foreach end -->

		  </td>
        </tr>
	</table>


		<script type="text/javascript" src="/jquery.min.js"></script>
		<script type="text/javascript" src="http://www.laoyou1.me/version1.3/js/layer/layer.js"></script>

		<script type="text/javascript">
		function guanbi(){
			layer.closeAll();
            // $('#information').hide();
			// document.cookie="name="+'s';
        }

		function last_night_info(e){
			// alert(33);
			// document.cookie="name="+e;
			// var username=document.cookie.split(";")[1].split("=")[1];
			// console.log(username);

			layer.open({
			      type: 1,
			      title: false,
			      closeBtn: 0,
			      shade: 0,
			    //   shade: [1, '#393D49'],
			      shadeClose:true,
			      scrollbar: false,
			      fixed: false,
			      border:0,
			      area: '500px',
			      offset: '20px',
			      content: $('#information'+e) //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});


	};
		function add_from(){
			// alert(33);
			// document.cookie="name="+e;
			// var username=document.cookie.split(";")[1].split("=")[1];
			// console.log(username);

			layer.open({
			      type: 1,
			      title: false,
			      closeBtn: 0,
			      shade: 0,
			    //   shade: [1, '#393D49'],
			      shadeClose:true,
			      scrollbar: false,
			      fixed: false,
			      border:0,
			      area: '500px',
			      offset: '20px',
			      content: $('#add_from') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});


	};

		</script>
